	import { ref } from 'vue';
	// 系统信息
	const systemInfo = uni.getSystemInfoSync()
	// console.log(systemInfo);
	// 状态栏高度
	const statusBarHeight = ref(systemInfo.statusBarHeight || 15)
	
	// 标题栏高度
	function getTitleBarHeight() {
		// 胶囊信息
		if (uni.getMenuButtonBoundingClientRect) {
			const {top, height} = uni.getMenuButtonBoundingClientRect()
			return (top - statusBarHeight.value) * 2 + height
		} else {
			return 50
		}
	}
	// 填充区高度
	function fillHeight() {
		return getTitleBarHeight() + statusBarHeight.value
	}
	
	// 抖音小程序适配
	function getLeftIcon() {
		// 条件编译
		// #ifdef MP-TOUTIAO
			const {leftIcon: {left, width}} = tt.getCustomButtonBoundingClientRect()
			return left + parseInt(width)
		// #endif
		
		// #ifndef MP-TOUTIAO
			return 0
		// #endif
		
	}
	export {
		statusBarHeight,
		getTitleBarHeight,
		fillHeight,
		getLeftIcon
	}